/*
 * @Author: zhangfeng
 * @Date: 2023-12-13 18:23:20
 * @LastEditTime: 2023-12-28 17:21:25
 * @LastEditors: zhangfeng
 * @Description:
 * @FilePath: \nodeapi\src\model\menu.model.js
 * © 2023 张峰，All rights reserved.
 */
const { DataTypes } = require("sequelize");
const seq = require("../db/seq");

const Menus = seq.define("zd_menus", {
  createBy: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "创建人",
  },
  createdTime: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "创建时间",
  },
  description: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "描述",
  },
  href: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "href",
  },
  icon: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "图标",
  },
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
    allowNull: true,
    comment: "ID",
  },
  level: {
    type: DataTypes.INTEGER,
    allowNull: true,
    comment: "等级",
  },
  name: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: true,
    comment: "菜单名称",
  },
  path: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: true,
    comment: "路由",
  },
  premi: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: true,
    comment: "权限描述符",
  },
  components: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "组件",
  },
  operatorId: {
    type: DataTypes.INTEGER,
    allowNull: true,
    comment: "操作人ID",
  },
  orderNum: {
    type: DataTypes.INTEGER,
    allowNull: true,
    comment: "顺序",
  },
  parentId: {
    type: DataTypes.INTEGER,
    allowNull: true,
    comment: "父ID",
  },
  shown: {
    type: DataTypes.BOOLEAN,
    allowNull: true,
    comment: "是否显示",
  },
  updatedBy: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "更新人",
  },
  updatedTime: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: "更新时间",
  },
});
// Menus.sync({ force: false });
module.exports = Menus;
